package com.neiquan.secondhand.service.impl;

import com.neiquan.backstage.core.bsc.impl.BasePersistentServiceImpl;
import com.neiquan.secondhand.po.Goods;
import com.neiquan.secondhand.service.CommonService;
import com.neiquan.secondhand.service.GoodService;
import com.neiquan.secondhand.util.Entity;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

/**
 * 商品实现类
 * @author chenjunnan
 *
 */
@Service
public class CommonServiceImpl  extends BasePersistentServiceImpl implements CommonService{



	@Override
	@SuppressWarnings("all")
	public List<Map> getAddress(String id) {
		StringBuilder  sql=new StringBuilder();
		List<Map> list=new ArrayList<Map>();
		if(id==null||"".equals(id)){
			sql.append("select a.dictionaries_id,a.name,a.BIANMA from sys_dictionaries a left join sys_dictionaries b on a.PARENT_ID=b.dictionaries_id where b.name like '%地区%'  order by a.ORDER_BY ");
			 list=(List<Map>)findListBySql(sql.toString(),0,Integer.MAX_VALUE,"map");
		}else{
			sql.append("select a.dictionaries_id,a.name,a.BIANMA from sys_dictionaries a where  a.PARENT_ID= '").append(id).append("' order by a.ORDER_BY ");
			 list=(List<Map>)findListBySql(sql.toString(),0,Integer.MAX_VALUE,"map");
		}
		 return list;
	}

}
